<?php
session_start();
?>
<html>

<head>

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>sans titre 1</title>
<link rel="stylesheet" href="style.css" />
</head>

<body>

	<div id="container">
	
		<div id="top">
		<?php include 'header.php'; ?>
		</div>
		
		<div id="leftnav">
			<?php include ("menu.php"); ?>
		</div>
 
		<div id="content">
		
		
			<?php
	try
	{
		include 'include/Data.php';
		$req = mysql_query('SELECT NumArticle,article.Titre,Prenom,Contenu,DateArticle,NbVue FROM article,utilisateur WHERE NumArticle = "'.$_GET['NumArticle'].'" AND article.NumUtilisateur = utilisateur.NumUtilisateur');
		$ligne = mysql_fetch_assoc($req);
                $cpt = $ligne['NbVue'] + 1;
                //$NumArticle = html_entity_decode($_GET['NumArticle']);
                //if (is_numeric($_GET['NumArticle'])) {
                $req2 = mysql_query('UPDATE article SET NbVue = '.$cpt.' WHERE NumArticle = "'.$_GET['NumArticle'].'"');
                $ligne2 = mysql_query($req2,$connexion);
		echo '<h2><center>'.$ligne['Titre'].'</center></h2><center><u>Créé par: '.$ligne['Prenom'].', le '.$ligne['DateArticle'].'</u></center><br><br>';
                echo $ligne['Contenu'];
                include 'include/Notation.php';
		include 'include/Commentaire.php';
                //}
                		mysql_close($connexion);
	}
	catch(Exception $e)
	{

	die('Erreur : '.$e->getMessage());
	}
	
	
?>
		</div>
		
		<div id="footer">
		<?php include 'footer.php'; ?>
		</div>
		
	</div></body>
</html>
